package com.wtb.javatool.util;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class FileUtil {
        public static String getMimeType(String fileName) {
            try {
                Path path = Paths.get(fileName);
                return Files.probeContentType(path);
            } catch (Exception e) {
                e.printStackTrace();
                return "application/octet-stream"; // 默认未知类型
            }
        }

}
